﻿#if UNITY_EDITOR
using UnityEngine;
using System.Collections;
using UnityEditor;
using System.Collections.Generic;

public class GetDependenciesPath
{
    [MenuItem("Slg/输出依赖资源的路径列表")]
    static void DebugDependenciesPath()
    {
        Object obj = Selection.activeObject;
        // for (int i = 0; i < trans.Length; i++)
        // {
        //     Object tran = trans[i];

        // }
        string prefabPath = AssetDatabase.GetAssetPath(obj);
        string[] paths = AssetDatabase.GetDependencies(prefabPath);
        List<string> ret = new List<string>();
        foreach (string path in paths)
        {
            if (ret.Contains(path) == false)
            {
                ret.Add(path);
            }
        }

        ret.Sort();
        foreach (var item in ret)
        {

            Debug.Log(item);
        }
    }

}
#endif